import {createRouter, createWebHistory} from 'vue-router'

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/',
            name: 'home',
            meta: {title: '首页'},
            component: () => import('@/views/Home.vue'),
        },
        {
            path: '/tips',
            name: 'tips',
            meta: {title: '使用说明'},
            component: () => import('@/views/Tips.vue'),
        },
        {
            path: '/update',
            name: 'update',
            meta: {title: '更新日志'},
            component: () => import('@/views/Update.vue'),
        },
        {
            path: '/author',
            name: 'author',
            meta: {title: '作者'},
            component: () => import('@/views/Author.vue'),
        },
        {
            path: '/general',
            name: 'general',
            meta: {title: '通用设置'},
            component: () => import('@/views/General.vue'),
        },
        {
            path: '/survivor',
            name: 'survivor',
            redirect: '/survivor/General',
            children: [
                {
                    path: 'general',
                    name: 'survivorGeneral',
                    meta: {title: '求生者通用'},
                    component: () => import('@/views/survivor/General.vue'),
                },
                {
                    path: 'character',
                    name: 'survivorCharacter',
                    meta: {title: '各求生者'},
                    component: () => import('@/views/survivor/Character.vue'),
                },
            ]
        },
        {
            path: '/hunter',
            name: 'hunter',
            redirect: '/hunter/General',
            children: [
                {
                    path: 'general',
                    name: 'hunterGeneral',
                    meta: {title: '监管者通用'},
                    component: () => import('@/views/hunter/General.vue'),
                },
                {
                    path: 'character',
                    name: 'hunterCharacter',
                    meta: {title: '各监管者'},
                    component: () => import('@/views/hunter/Character.vue'),
                },
            ]
        },
        {
            path: '/other',
            name: 'other',
            redirect: '/other/General',
            children: [
                {
                    path: 'general',
                    name: 'otherGeneral',
                    meta: {title: '其他通用'},
                    component: () => import('@/views/other/General.vue'),
                },
                {
                    path: 'mode',
                    name: 'otherMode',
                    meta: {title: '各模式'},
                    component: () => import('@/views/other/Mode.vue'),
                },
            ]
        },
    ],
})

export default router
